from rest_framework import serializers
from models import mBook

class mBookSerializer(serializers.Serializer):
     #此处和模型文件一致
    name = serializers.CharField(max_length=30,null=False)
    author = serializers.CharField(max_length=30,null=False)
    image = serializers.ImageField(null=False)
    available = serializers.BooleanField(default=False)
    timestamp = serializers.DateTimeField(auto_now_add=True)
